package com.msb.advice;

import com.msb.result.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


/**
 * @ClassName: CustomExceptionHandle
 * @Author: zw
 * @Description: 出百万拳，行万里路；
 * @Create 2024/8/4-18:21
 * @Version 1.0
 */
@RestControllerAdvice
public class CustomExceptionHandle {
    private Logger logger =  LoggerFactory.getLogger(CustomExceptionHandle.class);
    @ExceptionHandler(value = Exception.class)
    public Result exceptionHandle(Exception e) {
        logger.info("未知异常:");
        return Result.error("未知异常");
    }
}
